# ddddocr 目前(2022-2-9)仅支持python <= 3.9版本
# https://github.com/sml2h3/ddddocr

import ddddocr

if __name__ == "__main__":
    ocr = ddddocr.DdddOcr()
    with open('./file/1.png', 'rb') as f:
        img_bytes = f.read()
    res = ocr.classification(img_bytes)

    print(res)


class Demo:
    fileName = ''

    def __init__(self, fileName):
        self.fileName = fileName

    def test(self):
        ocr1 = ddddocr.DdddOcr()
        with open(self.fileName, 'rb') as f1:
            img_bytes1 = f1.read()
        return ocr1.classification(img_bytes1)
